package com.yisen.dasan.dao;

import com.yisen.dasan.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;
import java.util.Map;

/**
 * @author yu258234
 * @Description: 答案表添加的mapper
 */
@Mapper
public interface AnswerMapper {
    /**
     * 对结果标记表进行插入操作
     * @param answerResultSign
     * @return
     */
    int addAnswerResultSign(AnswerResultSign answerResultSign);

    /**
     * 对单选题答案表进行插入操作
     * @param answerRadio
     * @return
     */
    int addAnswerRadio(AnswerRadio answerRadio);

    /**
     * 对填空题答案表进行插入操作
     * @param answerCompletion
     * @return
     */
    int addAnswerCompletion(AnswerCompletion answerCompletion);

    /**
     * 对简答题答案表进行插入操作
     * @param answerField
     * @return
     */
    int addAnswerField(AnswerField answerField);

    /**
     * 对数字答案表进行插入操作
     * @param answerNumber
     * @return
     */
    int addAnswerNumber(AnswerNumber answerNumber);

    /**
     * 对多选题答案表进行插入操作
     * @param list
     * @return
     */
    int addAnswerMultiple(List<AnswerMultiple> list);

    /**
     * 对图片单选答案表进行插入操作
     * @param answerImgRadio
     * @return
     */
    int addAnswerImgRadio(AnswerImgRadio answerImgRadio);

    /**
     * 对下拉菜单进行插入操作
     * @param answerSelect
     * @return
     */
    int addAnswerSelect(AnswerSelect answerSelect);

    /**
     *
     * @param answerName
     * @return
     */
    int addAnswerName(AnswerName answerName);
    int addAnswerGender(Map map);
    int addAnswerEducation(Map map);
    int addAnswerAge(Map map);
    int addAnswerIphone(Map map);
    int addAnswerEmail(Map map);
    int addAnswerMobile(Map map);
    int addAnswerBirthday(Map map);

    /**
     * 查询已填写的数据（结果标记表关联其他答案表关联查询）
     * @param formId
     * @return
     */
//    List<AnswerResultSign> getAnswerResultSign(int formId);
//
//    AnswerDao getCompletion(int id);
//    AnswerDao getField(int id);
//    AnswerDao getNumber(int id);
//    AnswerDao getRadio(int id);
//    AnswerDao getImgRadio(int id);
//    AnswerDao getMultiple(int id);

    /**
     * 获取表单项所需信息
     * @param formId
     * @return
     */
    List<Map> getFormItem(@Param("formId") int formId);

    /**
     * 获取所有答案标记
     * @param formId
     * @return
     */
    List<Map> getResultSign(@Param("formId") int formId);

    /**
     * 获取单选题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerRadio(@Param("itemId") int itemId,@Param("signs") List<String> signs);

    /**
     * 获取多选题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerMultiple(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    /**
     * 获取填空题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerCompletion(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    /**
     * 获取简答题题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerField(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    /**
     * 获取数字题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerNumber(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    /**
     * 获取数字题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerImageradio(@Param("itemId") int itemId,@Param("signs") List<String> signs);

    /**
     * 获取下拉题答案
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerSelect(@Param("itemId") int itemId,@Param("signs") List<String> signs);

    /**
     *
     * @param itemId
     * @param signs
     * @return
     */
    List<Map> getAnswerName(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerGender(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerEducation(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerAge(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerIphone(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerEmail(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerMobile(@Param("itemId") int itemId,@Param("signs") List<String> signs);
    List<Map> getAnswerBirthday(@Param("itemId") int itemId,@Param("signs") List<String> signs);
}
